; print a string without using bios (for our switch into 32 bit protected mode)

[bits 32]

; constants
VIDEO_MEMORY	equ	0xb8000
WHITE_ON_BLACK	equ	0x0f

; function to print a null terminated string pointed to by EBX
print_string_pm:

pusha
mov	edx,	VIDEO_MEMORY

print_string_pm_loop:
mov	al,	[ebx]
mov	ah,	WHITE_ON_BLACK

cmp	al,	0
je	print_string_pm_done

mov	[edx],	ax	; it's 2 bytes per character - one for the char (al) and one for attributes (ah)

inc	ebx		; next char in the string
add	edx,	2	; next location in video memory

jmp	print_string_pm_loop

print_string_pm_done:
popa
ret
